
<template>
  <div id="app" v-if="isRouterChange">
      <div class="context" ref="context">

            <!--数据表格-->
            <!-- <el-table v-if="isInit" ref="singleTable"
                        :data="tableData"
                        :height="tableHeight"
                        @sort-change="sortChange"
                        v-loading="loading" size="mini"
                        style="width: 100%;" stripe=stripe border=border>
                <el-table-column type="index"  width="50" fixed="left" :label="$t('actorTable.xh')" align="center">
                </el-table-column>
                <el-table-column prop="actorNo" min-width="110" :label="$t('assetsAudit.actorInfo.actorNo')" sortable="custom" sort-by="identifier" fixed="left">
                </el-table-column>
                <el-table-column prop="actorName" min-width="130" :label="$t('assetsAudit.actorInfo.actorName')" sortable="custom" sort-by="byName" fixed="left">
                </el-table-column>
                <el-table-column prop="profession" min-width="150" :label="$t('assetsAudit.actorInfo.profession')" sortable="custom" sort-by="profession">
                </el-table-column>
                <el-table-column prop="sex" min-width="110" :label="$t('assetsAudit.actorInfo.sex')" sortable="custom" sort-by="sex">
                </el-table-column>
                <el-table-column prop="nationality" min-width="110" :label="$t('assetsAudit.actorInfo.nationality')" sortable="custom" sort-by="nationality">
                </el-table-column>
                <el-table-column prop="status" min-width="110" :label="$t('assetsAudit.actorInfo.status')" sortable="custom" sort-by="status">
                </el-table-column>
            </el-table> -->
            <!-- 数据展示区 -->
            <div class="dataBox" ref="dataBox">

                <el-table v-if="isInit" ref="singleTable"
                            :data="tableData"
                            :height="tableHeight"
                            @sort-change="sortChange"
                            v-loading="loading" size="mini"
                            style="width: 100%;" stripe=stripe border=border>
                    <el-table-column type="index"  width="70" fixed="left"
                        :label="$t('table.xh')" align="center">
                    </el-table-column>
                    <!-- <el-table-column prop="reviewDataId" min-width="200" fixed="left"
                        :label="$t('table.assetsAudit.assetCode')" sortable="custom" sort-by="reviewDataId">
                    </el-table-column> -->
                    <el-table-column prop="assetName" min-width="150" fixed="left" v-if="datas.assetName.key=='assetName'"
                        :label="$t('assetsAudit.assetName')" >
                    </el-table-column>
                    <el-table-column prop="assetName" min-width="150" fixed="left" v-if="datas.assetName.key=='subassetName'"
                        :label="$t('assetsAudit.subAssets.subAssetName')" sortable="custom" sort-by="assetName">
                    </el-table-column>
                    <!-- <el-table-column prop="source" min-width="110"
                        :label="$t('table.assetsAudit.source')" sortable="custom" sort-by="code">
                    </el-table-column>
                    <el-table-column prop="assetsType" min-width="110"
                        :label="$t('table.assetsAudit.assetsType')" sortable="custom" sort-by="name">
                    </el-table-column>
                    <el-table-column prop="moreInfo" min-width="110"
                        :label="$t('table.assetsAudit.moreInfo')" sortable="custom" sort-by="code">
                    </el-table-column> -->
                    <el-table-column prop="approvalStatus" min-width="110"
                        :label="$t('assetsAudit.auditStatus')" sortable="custom" sort-by="approvalStatus">
                    </el-table-column>
                    <!-- 审核意见 -->
                    <el-table-column prop="reviewDesc" min-width="220"
                        :label="$t('assetsAudit.reviewDesc')" sortable="custom" sort-by="reviewDesc">
                    </el-table-column>
                    <!-- <el-table-column prop="updateTime" min-width="180"
                        :label="$t('table.assetsAudit.updateTime')" sortable="custom" sort-by="name">
                    </el-table-column> -->
                    <el-table-column prop="lastUpdatedDate" min-width="180"
                        :label="$t('assetsAudit.auditTimeLast')" sortable="custom" sort-by="lastUpdatedDate">
                    </el-table-column>
                    <el-table-column prop="modifier" min-width="120"
                        :label="$t('table.assetsAudit.auditor')" sortable="custom" sort-by="modifier">
                    </el-table-column>
                </el-table>


            </div>
        </div>

  </div>


</template>

<script>
import comBaseVue from '../../baseViewModel';

export default {
  mixins: [comBaseVue],
  name: 'AuditRecord',
  data () {
    return {
        //真正的实体类名称
        modelName:"com.ispr.iptv.entity.audit.ReviewHisEntity",
        // 是否正在提交中
        loading: false,
        isInit:false,
        isRouterChange:true,
        tableHeight:600,
        appDivStyle:{
            height:this.$store.getters.appHeight,
        },
        //tableHeight:0,
        // 查询条件
        // formQueryCondition: {
        //     code: {              
        //         key: 'reviewDataId', 
        //         op: '=', // 操作符
        //         val: '' 
        //     },             
        //     type: {              
        //         key: 'reviewDataType', 
        //         op: '=', // 操作符
        //         val: '' 
        //     },      
        // },
        queryformLabelWidth:"75px",
        editformLabelWidth: '120px',
        editFormPosition: "right",
        // 是否显示编辑面板
        isShowEditForm: false,
        // 当前编辑面板执行的命令
        curCommand: "SaveNew",
        canEditCode:false,

    }
  },
  methods:{
     initTable:function(){
        // this.tableHeight = this.$refs.context.offsetHeight;
        this.isInit = true;
    },

    // 查询按钮
    onQuery: function() {
        this.pager.curPage = 1;
        this.queryTable();
    },
    // 查询网格数据
    queryTable: function() {
        this.loading = true;
        let data = {code:{"key":"reviewDataId","op":"=","val":this.datas.code.val},type:{"key":"reviewDataType","op":"=","val":this.datas.type.val}};
        this.queryModel(this.modelName,"Query",data,this.pager,this.sort,this.setTableData)
        // this.queryModel("com.ispr.iptv.entity.media.AssetEntity","Query",this.datas,this.pager,this.sort,this.setTableData);
    },
   // 查询网格数据成功后的回调
    setTableData: function(isSuccess,json) {
        this.loading = false;
        try{
            if (isSuccess) {
                //alert(JSON.stringify(json));
                this.pager.total = json.total;
                this.tableData = [];
                for (var i = 0; i < json.list.length; i++) {
                    var temp = json.list[i];
                    temp.assetName = this.datas.assetName.val;
                    this.tableData.push(temp);
                }
                
            }
            else {
                this.$message.error(json.msg);
            }
        }
        catch(e){
            alert(e);
        }
    },


  },
  props:['datas'],
  mounted: function mounted() {
    this.onQuery();
    window.setTimeout(this.initTable,100);
    
  },
}


</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
